<template>
  <Search @search="handleSearch" />
  <div class="container">
    <HomeCategory />
    <HomeBanner />
  </div>
  <HomeGoods :keyword="searchKeyword"/>
</template>

<script setup>
import { ref } from 'vue'
import Search from './components/Search.vue';
import HomeCategory from './components/HomeCategory.vue'
import HomeBanner from './components/HomeBanner.vue'
import HomeGoods from './components/HomeGoods.vue'

const searchKeyword = ref(''); // 定义关键词

// 处理搜索事件
const handleSearch = (keyword) => {
  searchKeyword.value = keyword; // 更新关键词
}
</script>